package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DbEnvelopeMapper;
import com.ruoyi.system.domain.DbEnvelope;
import com.ruoyi.system.service.IDbEnvelopeService;

/**
 * 优惠券领取 Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-08
 */
@Service
public class DbEnvelopeServiceImpl implements IDbEnvelopeService 
{
    @Autowired
    private DbEnvelopeMapper dbEnvelopeMapper;

    /**
     * 查询优惠券领取 
     * 
     * @param id 优惠券领取 主键
     * @return 优惠券领取 
     */
    @Override
    public DbEnvelope selectDbEnvelopeById(Long id)
    {
        return dbEnvelopeMapper.selectDbEnvelopeById(id);
    }

    /**
     * 查询优惠券领取 列表
     * 
     * @param dbEnvelope 优惠券领取 
     * @return 优惠券领取 
     */
    @Override
    public List<DbEnvelope> selectDbEnvelopeList(DbEnvelope dbEnvelope)
    {
        return dbEnvelopeMapper.selectDbEnvelopeList(dbEnvelope);
    }

    /**
     * 新增优惠券领取 
     * 
     * @param dbEnvelope 优惠券领取 
     * @return 结果
     */
    @Override
    public int insertDbEnvelope(DbEnvelope dbEnvelope)
    {
        dbEnvelope.setCreateTime(DateUtils.getNowDate());
        return dbEnvelopeMapper.insertDbEnvelope(dbEnvelope);
    }

    /**
     * 修改优惠券领取 
     * 
     * @param dbEnvelope 优惠券领取 
     * @return 结果
     */
    @Override
    public int updateDbEnvelope(DbEnvelope dbEnvelope)
    {
        dbEnvelope.setUpdateTime(DateUtils.getNowDate());
        return dbEnvelopeMapper.updateDbEnvelope(dbEnvelope);
    }

    /**
     * 批量删除优惠券领取 
     * 
     * @param ids 需要删除的优惠券领取 主键
     * @return 结果
     */
    @Override
    public int deleteDbEnvelopeByIds(Long[] ids)
    {
        return dbEnvelopeMapper.deleteDbEnvelopeByIds(ids);
    }

    /**
     * 删除优惠券领取 信息
     * 
     * @param id 优惠券领取 主键
     * @return 结果
     */
    @Override
    public int deleteDbEnvelopeById(Long id)
    {
        return dbEnvelopeMapper.deleteDbEnvelopeById(id);
    }
}
